home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 19
/
CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso
/
CUCD
/
Programming
/
LEDA
/
prog
/
dict
/
p_dic.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-05
|
463b
|
32 lines
#include <LEDA/p_dictionary.h>
#include <LEDA/list.h>
#include <math.h>
typedef p_dictionary<float,string> PDIC;
main()
{
p_dictionary<float,string> Dic;
list<PDIC> L;
int n = read_int("n = ");
for(int i = 1; i<n; i++)
{ Dic = Dic.insert(sqrt(i),string("sqrt(%d)",i));
L.append(Dic);
}
forall(Dic,L)
{ p_dic_item it;
forall_items(it,Dic) cout << Dic.inf(it) << "=" << Dic.key(it) << " ";
newline;
}
return 0;
}